package com.nengchuan.eic.nceconomy.service;

import com.nengchuan.eic.nceconomy.component.excel.ResponseModel;
import com.nengchuan.eic.nceconomy.entity.dto.ExcelDetailDTO;
import com.nengchuan.eic.nceconomy.entity.dto.ExcelInfoDTO;
import com.nengchuan.eic.nceconomy.entity.po.ExcelFile;
import com.nengchuan.eic.nceconomy.entity.po.ExcelVerify;
import com.nengchuan.eic.nceconomy.entity.po.OriginIndexData;
import com.baomidou.mybatisplus.extension.service.IService;
import com.nengchuan.eic.nceconomy.entity.vo.ExcelSheetListVO;
import com.nengchuan.eic.nceconomy.entity.vo.IndexSearchResultVO;
import com.nengchuan.eic.nceconomy.entity.vo.SheetDetail;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 原始和指标数据表 服务类
 * </p>
 *
 * @author luoping
 * @since 2020-04-23
 */
public interface OriginIndexDataService extends IService<OriginIndexData> {
    /**
     * 查询详情
     * @param excelDetailDTO
     * @return
     */
    SheetDetail getSheetDetail(ExcelDetailDTO excelDetailDTO);
    /**
     * 查询excel  sheetList
     * @param
     * @return
     */
    ExcelSheetListVO getSheetList(String excelId);

    /**
     * 获取文件
     * @param excelId
     * @return
     * @throws Exception
     */
    String download(String excelId) throws Exception;


    @Transactional(rollbackFor = Exception.class)
    ExcelInfoDTO save(ResponseModel responseModel, ExcelVerify excelVerify, ExcelFile excelFile, Long userId, String realName) throws InterruptedException;

    /**
     * 通过projectId获取excel第一张表的id
     * @param projectId
     * @return
     */
    ExcelDetailDTO getSheetOneId(String pid,String projectId, String category, String project, String version);

    /**
     * 根据父id查询sheetList
     * @param id
     * @return
     */
    List<Map<String,Object>> getSheetListByPid(Long id,Long sheetId);

    /**
     * 根据指标及模板sheetId查询相应数据
     * @param index
     * @param sheetName
     * @param category
     * @param projectId
     * @param pid
     * @return
     */
    IndexSearchResultVO indexSearchData(String index, String sheetName, List<String> category, String projectIndex, Long projectId, Long pid);
}
